import inputCommon from '../../../../mixin/inputCommon'
import requiredLabel from '../../../../components/requiredLabel'

export default {
  name: 'render',
  components: { requiredLabel },
  props: ['config', 'editor', 'isMobile'],
  inject: ['rootForm'],
  mixins: [inputCommon],
  data() {
    return {
      imgSrc: undefined,
      contentText: '',
      clickSYS: () => {
        this.scan()
      }

    }
  },
  methods: {
    scan() {
      var noData = "{\n" +
                  "    \"app_key\":\"三方H5APP唯一识别号\",\n" +
                  "    \"version\":\"1.0.0\"\n" +
                  "}\n"

      dsBridge.call("FunctionApi.scan", noData, (v) => {
        console.log(v)
        if(v && v.data && v.data.value) {
          this.rootForm.properties[this.config.propertyName] = v.data.value
        } else {
          this.rootForm.properties[this.config.propertyName] = ''
        }
      })
    }
  }
}
